Deciding License Token Lifetime

Once successfully started, the application must periodically confirm its continued existence to the License Manager for network licenses or to the client library in the case of standalone licenses. In other words, the application renews the license token. The period of time between renewals is called the license token lifetime or key lifetime. This ensures that the License Manager releases the token and makes it available to another application just in case the original application crashes without releasing the token.

You can set the lifetime value (in minutes, between 1 to 900 minutes) at the time of license generation (in WlscGen or lscgen) or by calling the VLScgSetKeyLifetime API function. Before that, you need to first choose the lifetime units from the following options (using the license generation utilities or the VLScgSetKeyLifetimeUnits API). After which you can specify a value accordingly:

> From 1 through 15 minutes (as multiple of 1 minute)

> From 10 through 150 minutes (as multiple of 10 minutes)

> From 30 through 450 minutes (as multiple of 30 minutes)

> From 60 through 900 minutes (as multiple of 60 minutes)

NOTE   If no value is set, then lifetime value of 5 minutes is set by default. The maximum allowed value is 900 minutes (15 hours).

NOTE   When auto timer is enabled, it is suggested to disable local renewal.

There are two ways to renew the license on the License Manager:

>Automatic License Renewal
In Automatic License Renewal, the application sends the update call after the 80% of the lifetime has elapsed. This process is timer- based on Windows and signal-based on UNIX and Linux ARM. By default, it is enabled on Windows, UNIX, and Linux ARM.

NOTE   It is not supported in Android 8 and above. You need to disable Automatic License Renewal using the API options provided below.

To turn ON\OFF the Automatic License Renewal, use the following APIs:

Unified API: Use the SNTL_ATTR_APPCONTEXT_AUTO_REFRESH attribute of the sntl_licensing_app_context_new API of the Unified API set.

Traditional API: Use the VLSdisableAutoTimer API function of the Traditional API set.

NOTE   You should check periodically on the update status. To do so:
- Unified API: Refer to the refreshStatus returned by  the sntl_licensing_get_session_info API.
- Traditional API: Call the VLSgetRenewalStatus. API to get information on whether the last successful update was local or remote.

>Manual License Renewal

In order to manually renew licenses, first turn off the automatic license renewal using the API options provided in previous section. Also, it may so happen that the platform you are working on does not support timers or you do not want to rely on timers to renew the license.



To manually renew licenses, call sntl_licensing_refresh (Unified API)/LSUpdate(Traditional API) periodically to renew the license and inform License Manager of its continued need for a license.



Both LSUpdate and sntl_licensing_refresh API are not signal-safe functions. Hence, they cannot be called from signal handlers.

More Recommendations Regarding License Renewals

>The time difference between two manual update calls must be greater than 1 second.

>The manual update calls should be timed when the 80% of the key lifetime is passed. If the update call is sent prior to 80% of the key lifetime period, then the license is renewed only locally. See the topic About Locally Renewing the License Tokens below.

>If you are renewing the token periodically, the update time interval set should not exceed the key lifetime value in the license. Otherwise, the License Manager will release the license before the client sends an update of its alive status.In this case, the previously issued token will be released and the license update call will be converted into a license request call. Now, the token will be issued depending on the availability of a license.

Locally Renewing License Tokens

Local renewal is the process of updating a network license locally (no check with the License Manager) within the first 80% of the lifetime of the license. If an update is called in the last 20% of the lifetime, the update will go to the License Manager. This is done to reduce network traffic.

If network traffic is not a factor or you wish to ensure that all updates are done via the License Manager, disable the traffic saving configuration. To do so:

>Unified API: Set the SNTL_ATTR_APPCONTEXT_ENABLE_LOCAL_RENEWAL attribute of the sntl_licensing_app_context_new API).

>Traditional API: Call the VLSdisableLocalRenewal API function to force all future renewal requests to go to the License Manager.

That part of the lifetime of a license which results in the renewal of the license by the License Manager is called the remote renewal period (see the shaded portion in the diagram). It starts after the 80% of the license lifetime has elapsed.

NOTE   Local license renewal is, by default, enabled on Windows, UNIX, and Linux ARM.

You may use the following functions related to update and renewal:

>VLSbatchUpdate: Updates several license authorizations at once.

>VLSdisableLocalRenewal: Forces all future license renewals to go to the License Manager. The Unified API-based implementations can set the SNTL_ATTR_APPCONTEXT_ENABLE_LOCAL_RENEWAL attribute of the sntl_licensing_app_context_new API.

>VLSenableLocalRenewal: The license renewals are handled locally. The Unified API-based implementations can set the SNTL_ATTR_APPCONTEXT_ENABLE_LOCAL_RENEWAL attribute of the sntl_licensing_app_context_new API.

>VLSisLocalRenewalDisabled: Informs you whether or not local updates are enabled.

>VLSgetRenewalStatus: Provides information on whether the last successful update was local or remote. The Unified API-based implementations can use the sntl_licensing_get_session_info API to obtain this information.

>VLSsetRemoteRenewalTime: Sets the remote renewal time period.